package cn.bouncyslime.graduationProject.nba.util;

public class ResponseData {
    private int status;
    private String statusText;
    private Object data;

    private ResponseData(int status, String statusText, Object data){
        this.statusText = statusText;
        this.status = status;
        this.data = data;
    }

    public static ResponseData success(Object data){
        return new ResponseData(1, "Success", data);
    }

    public static ResponseData fail(Object data){
        return new ResponseData(0, "Fail", data);
    }

    public static ResponseData error(Object data) {
        return new ResponseData(-1, "error", data);
    }

    public int getStatus() {
        return status;
    }

    public void setStatusText(String statusText) {
        this.statusText = statusText;
    }

    public String getStatusText() {
        return statusText;
    }

    public Object getData() {
        return data;
    }

    @Override
    public String toString() {
        return "ResponseData{" +
                "status=" + status +
                ", statusText='" + statusText + '\'' +
                ", data=" + data +
                '}';
    }
}
